program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  x1, y1, x2, y2, r1, r2: Integer;
  dx, dy, d: Real;
  a1, b1, c1, a2, b2, c2, a3, b3, c3, a4, b4, c4: real;
begin
  Writeln('enter x1, y1, r1');
  Readln(x1, y1, r1);
  Writeln('enter x2, y2, r2');
  Readln(x2, y2, r2);
  dx:=x1-x2;
  dy:=y1-y2;
  d:=dx*dx+dy*dy;
  if (Sqrt(d)<r1+r2) then
    Writeln('It is so bad');
  if (Sqrt(d)>r1+r2) then
  begin
    a1:=((r1+r2)*dx+dy*sqrt(d-(r1+r2)*(r1+r2)))/d;
    b1:=((r1+r2)*dy-dx*sqrt(d-(r1+r2)*(r1+r2)))/d;
    c1:=-a1*x2-b1*x2-r2;
    a2:=((r1+r2)*dx-dy*sqrt(d-(r1+r2)*(r1+r2)))/d;
    b2:=((r1+r2)*dy+dx*sqrt(d-(r1+r2)*(r1+r2)))/d;
    c2:=-a2*x2-b2*x2-r2;
    a3:=((r1-r2)*dx+dy*sqrt(d-(r1-r2)*(r1-r2)))/d;
    b3:=((r1-r2)*dy-dx*sqrt(d-(r1-r2)*(r1-r2)))/d;
    c3:=-a3*x2-b3*x2+r2;
    a4:=((r1-r2)*dx-dy*sqrt(d-(r1-r2)*(r1-r2)))/d;
    b4:=((r1-r2)*dy+dx*sqrt(d-(r1-r2)*(r1-r2)))/d;
    c4:=-a4*x2-b4*x2+r2;
    Writeln('a1= ', a1:0:3, '   b1= ', b1:0:3, '   c1= ', c1:0:3);
    Writeln('a2= ', a2:0:3, '   b2= ', b2:0:3, '   c2= ', c2:0:3);
    Writeln('a3= ', a3:0:3, '   b3= ', b3:0:3, '   c3= ', c3:0:3);
    Writeln('a4= ', a4:0:3, '   b4= ', b4:0:3, '   c4= ', c4:0:3);
  end;
  Readln;
end.
 